3.521 \(\int \cos ^2(c+d x) (a+b \tan (c+d x))^2 \, dx\)

Optimal. Leaf size=49 \[ \frac{1}{2} x \left (a^2+b^2\right )-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))}{2 d} \]

[Out]

((a^2 + b^2)*x)/2 - (Cos[c + d*x]^2*(b - a*Tan[c + d*x])*(a + b*Tan[c + d*x]))/(2*d)

________________________________________________________________________________________

Rubi [A]  time = 0.0528003, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3506, 723, 203} \[ \frac{1}{2} x \left (a^2+b^2\right )-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^2*(a + b*Tan[c + d*x])^2,x]

[Out]

((a^2 + b^2)*x)/2 - (Cos[c + d*x]^2*(b - a*Tan[c + d*x])*(a + b*Tan[c + d*x]))/(2*d)

Rule 3506

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(b*f), Subst
[Int[(a + x)^n*(1 + x^2/b^2)^(m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x] && NeQ[a^2 + b
^2, 0] && IntegerQ[m/2]

Rule 723

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(a*e - c*d*x)*(a
 + c*x^2)^(p + 1))/(2*a*c*(p + 1)), x] + Dist[((2*p + 3)*(c*d^2 + a*e^2))/(2*a*c*(p + 1)), Int[(d + e*x)^(m -
2)*(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ[m + 2*p + 2, 0] && Lt
Q[p, -1]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \cos ^2(c+d x) (a+b \tan (c+d x))^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{(a+x)^2}{\left (1+\frac{x^2}{b^2}\right )^2} \, dx,x,b \tan (c+d x)\right )}{b d}\\ &=-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))}{2 d}+\frac{\left (a^2+b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{x^2}{b^2}} \, dx,x,b \tan (c+d x)\right )}{2 b d}\\ &=\frac{1}{2} \left (a^2+b^2\right ) x-\frac{\cos ^2(c+d x) (b-a \tan (c+d x)) (a+b \tan (c+d x))}{2 d}\\ \end{align*}

Mathematica [A]  time = 0.125098, size = 52, normalized size = 1.06 \[ \frac{2 \left (a^2+b^2\right ) (c+d x)+\left (a^2-b^2\right ) \sin (2 (c+d x))-2 a b \cos (2 (c+d x))}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[c + d*x]^2*(a + b*Tan[c + d*x])^2,x]

[Out]

(2*(a^2 + b^2)*(c + d*x) - 2*a*b*Cos[2*(c + d*x)] + (a^2 - b^2)*Sin[2*(c + d*x)])/(4*d)

________________________________________________________________________________________

Maple [A]  time = 0.046, size = 70, normalized size = 1.4 \begin{align*}{\frac{1}{d} \left ({b}^{2} \left ( -{\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) - \left ( \cos \left ( dx+c \right ) \right ) ^{2}ab+{a}^{2} \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^2*(a+b*tan(d*x+c))^2,x)

[Out]

1/d*(b^2*(-1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/2*c)-cos(d*x+c)^2*a*b+a^2*(1/2*cos(d*x+c)*sin(d*x+c)+1/2*d*x+1/
2*c))

________________________________________________________________________________________

Maxima [A]  time = 2.24816, size = 74, normalized size = 1.51 \begin{align*} \frac{{\left (a^{2} + b^{2}\right )}{\left (d x + c\right )} - \frac{2 \, a b -{\left (a^{2} - b^{2}\right )} \tan \left (d x + c\right )}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

1/2*((a^2 + b^2)*(d*x + c) - (2*a*b - (a^2 - b^2)*tan(d*x + c))/(tan(d*x + c)^2 + 1))/d

________________________________________________________________________________________

Fricas [A]  time = 1.77913, size = 120, normalized size = 2.45 \begin{align*} -\frac{2 \, a b \cos \left (d x + c\right )^{2} -{\left (a^{2} + b^{2}\right )} d x -{\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right )}{2 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/2*(2*a*b*cos(d*x + c)^2 - (a^2 + b^2)*d*x - (a^2 - b^2)*cos(d*x + c)*sin(d*x + c))/d

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan{\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**2*(a+b*tan(d*x+c))**2,x)

[Out]

Integral((a + b*tan(c + d*x))**2*cos(c + d*x)**2, x)

________________________________________________________________________________________

Giac [B]  time = 1.47207, size = 331, normalized size = 6.76 \begin{align*} \frac{a^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + b^{2} d x \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + a^{2} d x \tan \left (d x\right )^{2} + b^{2} d x \tan \left (d x\right )^{2} + a^{2} d x \tan \left (c\right )^{2} + b^{2} d x \tan \left (c\right )^{2} - a b \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - a^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) + b^{2} \tan \left (d x\right )^{2} \tan \left (c\right ) - a^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} + b^{2} \tan \left (d x\right ) \tan \left (c\right )^{2} + a^{2} d x + b^{2} d x + a b \tan \left (d x\right )^{2} + 4 \, a b \tan \left (d x\right ) \tan \left (c\right ) + a b \tan \left (c\right )^{2} + a^{2} \tan \left (d x\right ) - b^{2} \tan \left (d x\right ) + a^{2} \tan \left (c\right ) - b^{2} \tan \left (c\right ) - a b}{2 \,{\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + d \tan \left (d x\right )^{2} + d \tan \left (c\right )^{2} + d\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^2*(a+b*tan(d*x+c))^2,x, algorithm="giac")

[Out]

1/2*(a^2*d*x*tan(d*x)^2*tan(c)^2 + b^2*d*x*tan(d*x)^2*tan(c)^2 + a^2*d*x*tan(d*x)^2 + b^2*d*x*tan(d*x)^2 + a^2
*d*x*tan(c)^2 + b^2*d*x*tan(c)^2 - a*b*tan(d*x)^2*tan(c)^2 - a^2*tan(d*x)^2*tan(c) + b^2*tan(d*x)^2*tan(c) - a
^2*tan(d*x)*tan(c)^2 + b^2*tan(d*x)*tan(c)^2 + a^2*d*x + b^2*d*x + a*b*tan(d*x)^2 + 4*a*b*tan(d*x)*tan(c) + a*
b*tan(c)^2 + a^2*tan(d*x) - b^2*tan(d*x) + a^2*tan(c) - b^2*tan(c) - a*b)/(d*tan(d*x)^2*tan(c)^2 + d*tan(d*x)^
2 + d*tan(c)^2 + d)